package com.xuanwei.core.enums;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/7/11 17:06
 **/
public enum OrderStatus {

    PAY_NO(0,"待支付"),
    PAY_SUCCESS(1,"待发货"),
    SEND(2,"待收货"),
    RECEIVE(3,"待评价"),
    SUCCESS(4,"已完成"),
    AFTER_SALE(5,"售后"),
    CLOSE(6,"已关闭"),
    NO(7,"待支付");

    private Integer code;

    private String msg;

    OrderStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;

    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getMessage(Integer code){
        OrderStatus[] values = values();
        for (OrderStatus orderStatus:values){
            if(orderStatus.getCode().equals(code)){
                return orderStatus.getMsg();
            }
        }
        return "";
    }

}
